.class final Lcom/melesta/engine/EngineActivity$12;
.super Ljava/lang/Object;
.source "EngineActivity.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/melesta/engine/EngineActivity;->purchaseProcessed(J)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation


# instance fields
.field final synthetic val$_id:J

.field final synthetic val$dbh:Lcom/melesta/engine/DatabaseHelper;

.field final synthetic val$pt:Lcom/melesta/payment/PaymentTransaction;


# direct methods
.method constructor <init>(Lcom/melesta/payment/PaymentTransaction;Lcom/melesta/engine/DatabaseHelper;J)V
    .locals 0
    .parameter
    .parameter
    .parameter

    .prologue
    .line 1722
    iput-object p1, p0, Lcom/melesta/engine/EngineActivity$12;->val$pt:Lcom/melesta/payment/PaymentTransaction;

    iput-object p2, p0, Lcom/melesta/engine/EngineActivity$12;->val$dbh:Lcom/melesta/engine/DatabaseHelper;

    iput-wide p3, p0, Lcom/melesta/engine/EngineActivity$12;->val$_id:J

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 6

    .prologue
    .line 1726
    :try_start_0
    #calls: Lcom/melesta/engine/EngineActivity;->canPostPromoCode()Z
    invoke-static {}, Lcom/melesta/engine/EngineActivity;->access$800()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 1727
    iget-object v2, p0, Lcom/melesta/engine/EngineActivity$12;->val$pt:Lcom/melesta/payment/PaymentTransaction;

    #calls: Lcom/melesta/engine/EngineActivity;->postPromoCode(Lcom/melesta/payment/PaymentTransaction;)V
    invoke-static {v2}, Lcom/melesta/engine/EngineActivity;->access$900(Lcom/melesta/payment/PaymentTransaction;)V

    .line 1730
    :cond_0
    iget-object v2, p0, Lcom/melesta/engine/EngineActivity$12;->val$pt:Lcom/melesta/payment/PaymentTransaction;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    iput-wide v3, v2, Lcom/melesta/payment/PaymentTransaction;->processingTime:J

    .line 1732
    iget-object v2, p0, Lcom/melesta/engine/EngineActivity$12;->val$dbh:Lcom/melesta/engine/DatabaseHelper;

    iget-wide v3, p0, Lcom/melesta/engine/EngineActivity$12;->val$_id:J

    iget-object v5, p0, Lcom/melesta/engine/EngineActivity$12;->val$pt:Lcom/melesta/payment/PaymentTransaction;

    invoke-virtual {v2, v3, v4, v5}, Lcom/melesta/engine/DatabaseHelper;->saveTransaction(JLcom/melesta/payment/PaymentTransaction;)J

    .line 1734
    invoke-static {}, Lcom/melesta/payment/PaymentManager;->getInstance()Lcom/melesta/payment/PaymentManager;

    move-result-object v1

    .line 1735
    .local v1, pm:Lcom/melesta/payment/PaymentManager;
    iget-object v2, p0, Lcom/melesta/engine/EngineActivity$12;->val$pt:Lcom/melesta/payment/PaymentTransaction;

    invoke-virtual {v1, v2}, Lcom/melesta/payment/PaymentManager;->purchaseProcessed(Lcom/melesta/payment/PaymentTransaction;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 1739
    .end local v1           #pm:Lcom/melesta/payment/PaymentManager;
    :goto_0
    return-void

    .line 1736
    :catch_0
    move-exception v0

    .line 1737
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/melesta/engine/Error;->processException(Ljava/lang/Exception;)V

    goto :goto_0
.end method
